<?php
namespace app\api\validate;

class Mingpian extends Base
{
    protected $rule =   [
        'name'          => 'require',
        'image'          => 'require',
        'sex'            => 'require',
        'school'         => 'require',
        'position'       => 'require',
        'schooling'      => 'require',
        'countries'      => 'require',
        'ethnic'         => 'require',
        'birthday'       => 'require',
        'personality'    => 'require',
        'hobbies'        => 'require',
        'username'       => 'require',
        'number'         => 'require',
        'weixin'         => 'require',
        'theme'          => 'require',
        'tel'            => 'require',
        'type'           => 'require',
        'front'          => 'require',
        'animal'        => 'require',
        'constellation'        => 'require',
        'blood_type'        => 'require',
        'log'        => 'require',
        'lat'        => 'require',


        
        
        # 分页
        'page'          => 'require|egt:0',
        'pagesize'      => 'require|between:1,100',

    ];
    
    protected $message  =   [
        'name.require'  => '昵称不能为空',
        'image.require'  => '头像不能为空',
        'sex.require'    => '性别不能为空',
        'school.require'  => '学校不能为空',
        'position.require'  => '专业不能为空',
        'schooling.require'  => '年级不能为空',
        'countries.require'  => '国籍不能为空',
        'ethnic.require'  => '民族不能为空',
        'birthday.require'  => '生日不能为空',
        'personality.require'  => '个性标签不能为空',
        'hobbies.require'  => '兴趣爱好不能为空',
        'username.require'  => '真实姓名不能为空',
        'number.require'  => '学号不能为空',
        'weixin.require'  => '联系方式不能为空',
        'theme.require'  => '主题不能为空',
        'tel.require'  => '手机号码不能为空',
        'type.require'  => '类型不能为空',
        'front.require'  => '正面证件不能为空',
        'reverse.require'  => '反面证件不能为空',
        'animal.require'   => '属相不能为空',
        'constellation.require'   => '星座不能为空',
        'blood_type.require'   => '血型不能为空',
        'log.require'   => '经度不能为空',
        'lat.require'   => '纬度不能为空',
        
        # 分页
        'page.require'  => '分页参数page必须',
        'page.egt'      => '分页参数page必须大于0',
        
    ];
    
    protected $scene =  [
        # 创建名片
        'create_card'   => ['name','image', 'sex', 'school', 'position','schooling','countries','ethnic','birthday',
                                   'personality','hobbies','username','number','weixin','theme'],
        # 身份认证
        'identity'      => ['tel','type','front','reverse'],
        
        # 分页场景
        'page'          => ['page', 'pagesize'],
        
        #名片搜索
        'card_search'   => ['log','lat','page','pagesize'],
    ];
    
}
